home *** CD-ROM | disk | FTP | other *** search
- #ifndef FWSEXCEP_H
- #define FWSEXCEP_H
- //========================================================================================
- //
- // File: FWSExcep.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include <stddef.h>
-
- //========================================================================================
- // Exception library new helper configuration
- //========================================================================================
-
- //??? This define should be moved from this file into the build env or proj prefix
- // Also, the logic should be inverted, i.e. FW_DONT_USE_NEW_HELPER. -JEL
-
- // [KVV] Need to disable New Helper for Visual C++ 2.0
- // FW_NEW_HELPER cannot be defined on the command line because of Mac compilers (MWerks...)
- // so here is another symbol which is defined when compiling Visual C++...
-
- #ifdef FW_NATIVE_EXCEPTIONS
- #ifndef FW_NO_NEW_HELPER
- #define FW_NO_NEW_HELPER
- #endif
- #endif
-
- #ifdef FW_NO_NEW_HELPER
- #ifdef FW_USE_NEW_HELPER
- #undef FW_USE_NEW_HELPER
- #endif
- #else
- #define FW_USE_NEW_HELPER
- #endif
-
- //========================================================================================
- // Header files
- //========================================================================================
-
- #ifndef FWCLAINF_H
- #include "FWClaInf.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR _FW_XException;
- class FW_CLASS_ATTR FW_CPrivTryBlockContext;
- class FW_CLASS_ATTR FW_CPrivSubHelper;
- class FW_CLASS_ATTR FW_CPrivDeleteEntry;
-
- #ifdef FW_USE_NEW_HELPER
- class FW_CLASS_ATTR FW_CPrivNewHelper;
- #endif
-
- typedef short _FW_StackEntries;
-
- typedef void (*PFV) ();
-
- typedef void* (*__FW_OperatorNewHandler)(size_t size);
- typedef void (*__FW_OperatorDeleteHandler)(void* p);
-
- //========================================================================================
- // STRUCT FW_SPrivExceptionGlobals
- //
- // Globals for exception handling system.
- // Only one instance of this struct will be instantiated per task.
- //
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma options align=mac68k
- #endif
-
- #ifdef FW_BUILD_WIN
- #pragma pack(push, 1)
- #endif
-
- struct FW_SPrivExceptionGlobals
- {
- short gInitialized;
-
- #ifndef FW_NATIVE_EXCEPTIONS
-
- FW_CPrivTryBlockContext* gBaseContext;
- FW_CPrivTryBlockContext* gCurrentContext;
- short gContextDepth;
-
- _FW_StackEntries gCurrentStackSize;
- FW_CPrivDeleteEntry* gStackBase;
- FW_CPrivDeleteEntry* gStackTop;
- FW_CPrivDeleteEntry* gStackLimit;
-
- long gExceptionBufferSize;
- void* gExceptionBuffer;
- _FW_XException* gCaughtException;
- _FW_XException* gThrownException;
- short gIsThrowing;
-
- PFV gCurrentTerminate;
- PFV gCurrentUnexpected;
-
- FW_ClassInfoPtr gBreakExceptionKind;
-
- #ifdef FW_USE_NEW_HELPER
- FW_CPrivNewHelper** gNewHelperStackBottom;
- FW_CPrivNewHelper** gNewHelperStackTop;
- FW_CPrivSubHelper* gSubHelperStorageArray;
- FW_CPrivSubHelper* gSubHelperFreeListHead;
- #endif
-
- #endif // FW_NATIVE_EXCEPTIONS
-
- __FW_OperatorNewHandler gOperatorNewHandler;
- __FW_OperatorDeleteHandler gOperatorDeleteHandler;
- };
-
- #ifdef FW_BUILD_MAC
- #pragma options align=reset
- #endif
-
- #ifdef FW_BUILD_WIN
- #pragma pack(pop)
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-